<template>
	<view>
		<view class="item dpflex"  @click="toInfo(item)" >
			<image :src="item.imgs" mode=""></image>
			<view class="flex1">
				<view>{{item.name}}</view>
				<view>{{item.type }} {{item.area}} {{item.range}}</view>
				<view class="tags">
					<view class="tag" v-for="(item1,index1) in item.tabs" :key="index1"> {{item1}}</view>
		
				</view>
				<view class="price">{{item.price}} / 平方</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"house-item",
		data() {
			return {
				
			};
		},
		props:{
			item:{
				type:Object,
				default:()=>({}) 
			}
		},
		methods:{
			//跳转页面
			toInfo(item){
				// 存数据到vuex 
				this.$store.commit('house/changeCurrent',item)
				//存数据到足迹数组
				this.$store.commit('house/addFootPrint',item)
				
				
				//跳转页面
				uni.navigateTo({
					url:'/pages/house/houseInfo'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.item {
		width: 100%;
		height: 300rpx;

		image {
			width: 300rpx;
			height: 200rpx;

		}
	}

	.tags {
		width: 100%;
		display: flex;
		flex-wrap: wrap;

		.tag {
			padding: 10rpx;
			background: #ccc;
			border-radius: 15rpx;
			color: #f44;
			margin: 5rpx;
		}
	}
</style>